/*     */ package dm.jdbc.rowset;
/*     */ 
/*     */ import dm.jdbc.dbaccess.DBError;
/*     */ import dm.jdbc.driver.DmdbResultSetMetaData;
/*     */ import java.io.Serializable;
/*     */ import java.sql.SQLException;
/*     */ import javax.sql.RowSetMetaData;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class DmdbRowSetMetaData
/*     */   implements RowSetMetaData, Serializable
/*     */ {
/*     */   private boolean[] m_autoIncr;
/*     */   private boolean[] m_caseSens;
/*     */   private String[] m_catalogName;
/*     */   private int m_columnCount;
/*     */   private int[] m_colDisplaySize;
/*     */   private String[] m_colDisplayLable;
/*     */   private String[] m_columnName;
/*     */   private String[] m_columnClassName;
/*     */   private int[] m_colSQLType;
/*     */   private String[] m_colTypeName;
/*     */   private boolean[] m_currency;
/*     */   private int[] m_nullable;
/*     */   private int[] m_precision;
/*     */   private int[] m_scale;
/*     */   private String[] m_schemaName;
/*     */   private boolean[] m_searchable;
/*     */   private boolean[] m_signed;
/*     */   private String[] m_tableName;
/*     */   private boolean[] m_readOnly;
/*     */   private boolean[] m_writeable;
/*     */   private boolean[] m_defWriteable;
/*     */   
/*     */   public DmdbRowSetMetaData(DmdbResultSetMetaData metaData)
/*     */     throws SQLException
/*     */   {
/*  78 */     initializeProps(metaData.getColumnCount(), metaData);
/*     */   }
/*     */   
/*     */   private void initializeProps(int columnCount, DmdbResultSetMetaData rsmd) throws SQLException
/*     */   {
/*  83 */     this.m_columnCount = columnCount;
/*     */     
/*  85 */     this.m_autoIncr = new boolean[this.m_columnCount];
/*  86 */     this.m_caseSens = new boolean[this.m_columnCount];
/*  87 */     this.m_catalogName = new String[this.m_columnCount];
/*  88 */     this.m_colDisplaySize = new int[this.m_columnCount];
/*  89 */     this.m_colDisplayLable = new String[this.m_columnCount];
/*  90 */     this.m_columnClassName = new String[this.m_columnCount];
/*  91 */     this.m_columnName = new String[this.m_columnCount];
/*  92 */     this.m_colSQLType = new int[this.m_columnCount];
/*  93 */     this.m_colTypeName = new String[this.m_columnCount];
/*  94 */     this.m_currency = new boolean[this.m_columnCount];
/*  95 */     this.m_nullable = new int[this.m_columnCount];
/*  96 */     this.m_precision = new int[this.m_columnCount];
/*  97 */     this.m_scale = new int[this.m_columnCount];
/*  98 */     this.m_schemaName = new String[this.m_columnCount];
/*  99 */     this.m_searchable = new boolean[this.m_columnCount];
/* 100 */     this.m_signed = new boolean[this.m_columnCount];
/* 101 */     this.m_tableName = new String[this.m_columnCount];
/* 102 */     this.m_readOnly = new boolean[this.m_columnCount];
/* 103 */     this.m_writeable = new boolean[this.m_columnCount];
/* 104 */     this.m_defWriteable = new boolean[this.m_columnCount];
/*     */     
/* 106 */     for (int i = 0; i < this.m_columnCount; i++) {
/* 107 */       this.m_autoIncr[i] = (rsmd == null ? 0 : rsmd.isAutoIncrement(i + 1));
/* 108 */       this.m_caseSens[i] = (rsmd == null ? 0 : rsmd.isCaseSensitive(i + 1));
/* 109 */       this.m_catalogName[i] = (rsmd == null ? "" : rsmd.getCatalogName(i + 1));
/* 110 */       this.m_colDisplaySize[i] = (rsmd == null ? 0 : rsmd
/* 111 */         .getColumnDisplaySize(i + 1));
/* 112 */       this.m_colDisplayLable[i] = (rsmd == null ? "" : rsmd
/* 113 */         .getColumnLabel(i + 1));
/* 114 */       this.m_columnClassName[i] = (rsmd == null ? "" : rsmd
/* 115 */         .getColumnClassName(i + 1));
/* 116 */       this.m_columnName[i] = (rsmd == null ? "" : rsmd.getColumnName(i + 1));
/* 117 */       this.m_colSQLType[i] = (rsmd == null ? 0 : rsmd.getColumnType(i + 1));
/* 118 */       this.m_colTypeName[i] = (rsmd == null ? "" : rsmd
/* 119 */         .getColumnTypeName(i + 1));
/* 120 */       this.m_currency[i] = (rsmd == null ? 0 : rsmd.isCurrency(i + 1));
/* 121 */       this.m_nullable[i] = (rsmd == null ? 0 : rsmd.isNullable(i + 1));
/* 122 */       this.m_precision[i] = (rsmd == null ? 0 : rsmd.getPrecision(i + 1));
/* 123 */       this.m_scale[i] = (rsmd == null ? 0 : rsmd.getScale(i + 1));
/* 124 */       this.m_schemaName[i] = (rsmd == null ? "" : rsmd.getSchemaName(i + 1));
/* 125 */       this.m_searchable[i] = (rsmd == null ? 0 : rsmd.isSearchable(i + 1));
/* 126 */       this.m_signed[i] = (rsmd == null ? 0 : rsmd.isSigned(i + 1));
/* 127 */       this.m_tableName[i] = (rsmd == null ? "" : rsmd.getTableName(i + 1));
/* 128 */       this.m_readOnly[i] = (rsmd == null ? 0 : rsmd.isReadOnly(i + 1));
/* 129 */       this.m_writeable[i] = (rsmd == null ? 0 : rsmd.isWritable(i + 1));
/* 130 */       this.m_defWriteable[i] = (rsmd == null ? 0 : rsmd
/* 131 */         .isDefinitelyWritable(i + 1));
/*     */     }
/*     */   }
/*     */   
/*     */   private void checkColumn(int column) throws SQLException {
/* 136 */     if ((column < 1) || (column > this.m_columnCount)) {
/* 137 */       DBError.throwSQLException(6010);
/*     */     }
/*     */   }
/*     */   
/*     */   public int getColumnCount() throws SQLException {
/* 142 */     return this.m_columnCount;
/*     */   }
/*     */   
/*     */   public boolean isAutoIncrement(int column) throws SQLException
/*     */   {
/* 147 */     checkColumn(column);
/* 148 */     return this.m_autoIncr[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isCaseSensitive(int column) throws SQLException
/*     */   {
/* 153 */     checkColumn(column);
/* 154 */     return this.m_caseSens[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isSearchable(int column) throws SQLException
/*     */   {
/* 159 */     checkColumn(column);
/* 160 */     return this.m_searchable[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isCurrency(int column) throws SQLException
/*     */   {
/* 165 */     checkColumn(column);
/* 166 */     return this.m_currency[(column - 1)];
/*     */   }
/*     */   
/*     */   public int isNullable(int column) throws SQLException
/*     */   {
/* 171 */     checkColumn(column);
/* 172 */     return this.m_nullable[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isSigned(int column) throws SQLException
/*     */   {
/* 177 */     checkColumn(column);
/* 178 */     return this.m_signed[(column - 1)];
/*     */   }
/*     */   
/*     */   public int getColumnDisplaySize(int column) throws SQLException
/*     */   {
/* 183 */     checkColumn(column);
/* 184 */     return this.m_colDisplaySize[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getColumnLabel(int column) throws SQLException
/*     */   {
/* 189 */     checkColumn(column);
/* 190 */     return this.m_colDisplayLable[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getColumnName(int column) throws SQLException
/*     */   {
/* 195 */     checkColumn(column);
/* 196 */     return this.m_columnName[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getSchemaName(int column) throws SQLException
/*     */   {
/* 201 */     checkColumn(column);
/* 202 */     return this.m_schemaName[(column - 1)];
/*     */   }
/*     */   
/*     */   public int getPrecision(int column) throws SQLException
/*     */   {
/* 207 */     checkColumn(column);
/* 208 */     return this.m_precision[(column - 1)];
/*     */   }
/*     */   
/*     */   public int getScale(int column) throws SQLException
/*     */   {
/* 213 */     checkColumn(column);
/* 214 */     return this.m_scale[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getTableName(int column) throws SQLException
/*     */   {
/* 219 */     checkColumn(column);
/* 220 */     return this.m_tableName[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getCatalogName(int column) throws SQLException
/*     */   {
/* 225 */     checkColumn(column);
/* 226 */     return this.m_catalogName[(column - 1)];
/*     */   }
/*     */   
/*     */   public int getColumnType(int column) throws SQLException
/*     */   {
/* 231 */     checkColumn(column);
/* 232 */     return this.m_colSQLType[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getColumnTypeName(int column) throws SQLException
/*     */   {
/* 237 */     checkColumn(column);
/* 238 */     return this.m_colTypeName[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isReadOnly(int column) throws SQLException
/*     */   {
/* 243 */     checkColumn(column);
/* 244 */     return this.m_readOnly[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isWritable(int column) throws SQLException
/*     */   {
/* 249 */     checkColumn(column);
/* 250 */     return this.m_writeable[(column - 1)];
/*     */   }
/*     */   
/*     */   public boolean isDefinitelyWritable(int column) throws SQLException
/*     */   {
/* 255 */     checkColumn(column);
/* 256 */     return this.m_defWriteable[(column - 1)];
/*     */   }
/*     */   
/*     */   public String getColumnClassName(int column) throws SQLException
/*     */   {
/* 261 */     checkColumn(column);
/* 262 */     return this.m_columnClassName[(column - 1)];
/*     */   }
/*     */   
/*     */   public void setColumnCount(int columnCount) throws SQLException
/*     */   {
/* 267 */     this.m_columnCount = columnCount;
/*     */   }
/*     */   
/*     */   public void setAutoIncrement(int columnIndex, boolean property)
/*     */     throws SQLException
/*     */   {
/* 273 */     checkColumn(columnIndex);
/* 274 */     this.m_autoIncr[(columnIndex - 1)] = property;
/*     */   }
/*     */   
/*     */   public void setCaseSensitive(int columnIndex, boolean property)
/*     */     throws SQLException
/*     */   {
/* 280 */     checkColumn(columnIndex);
/* 281 */     this.m_caseSens[(columnIndex - 1)] = property;
/*     */   }
/*     */   
/*     */   public void setSearchable(int columnIndex, boolean property)
/*     */     throws SQLException
/*     */   {
/* 287 */     checkColumn(columnIndex);
/* 288 */     this.m_searchable[(columnIndex - 1)] = property;
/*     */   }
/*     */   
/*     */   public void setCurrency(int columnIndex, boolean property)
/*     */     throws SQLException
/*     */   {
/* 294 */     checkColumn(columnIndex);
/* 295 */     this.m_currency[(columnIndex - 1)] = property;
/*     */   }
/*     */   
/*     */   public void setNullable(int columnIndex, int property) throws SQLException
/*     */   {
/* 300 */     checkColumn(columnIndex);
/* 301 */     this.m_nullable[(columnIndex - 1)] = property;
/*     */   }
/*     */   
/*     */   public void setSigned(int columnIndex, boolean property)
/*     */     throws SQLException
/*     */   {
/* 307 */     checkColumn(columnIndex);
/* 308 */     this.m_signed[(columnIndex - 1)] = property;
/*     */   }
/*     */   
/*     */   public void setColumnDisplaySize(int columnIndex, int size)
/*     */     throws SQLException
/*     */   {
/* 314 */     checkColumn(columnIndex);
/* 315 */     this.m_colDisplaySize[(columnIndex - 1)] = size;
/*     */   }
/*     */   
/*     */   public void setColumnLabel(int columnIndex, String label)
/*     */     throws SQLException
/*     */   {
/* 321 */     checkColumn(columnIndex);
/* 322 */     this.m_colDisplayLable[(columnIndex - 1)] = label;
/*     */   }
/*     */   
/*     */   public void setColumnName(int columnIndex, String columnName)
/*     */     throws SQLException
/*     */   {
/* 328 */     checkColumn(columnIndex);
/* 329 */     this.m_columnName[(columnIndex - 1)] = columnName;
/*     */   }
/*     */   
/*     */   public void setSchemaName(int columnIndex, String schemaName)
/*     */     throws SQLException
/*     */   {
/* 335 */     checkColumn(columnIndex);
/* 336 */     this.m_schemaName[(columnIndex - 1)] = schemaName;
/*     */   }
/*     */   
/*     */   public void setPrecision(int columnIndex, int precision)
/*     */     throws SQLException
/*     */   {
/* 342 */     checkColumn(columnIndex);
/* 343 */     this.m_precision[(columnIndex - 1)] = precision;
/*     */   }
/*     */   
/*     */   public void setScale(int columnIndex, int scale) throws SQLException
/*     */   {
/* 348 */     checkColumn(columnIndex);
/* 349 */     this.m_scale[(columnIndex - 1)] = scale;
/*     */   }
/*     */   
/*     */   public void setTableName(int columnIndex, String tableName)
/*     */     throws SQLException
/*     */   {
/* 355 */     checkColumn(columnIndex);
/* 356 */     this.m_tableName[(columnIndex - 1)] = tableName;
/*     */   }
/*     */   
/*     */   public void setCatalogName(int columnIndex, String catalogName)
/*     */     throws SQLException
/*     */   {
/* 362 */     checkColumn(columnIndex);
/* 363 */     this.m_catalogName[(columnIndex - 1)] = catalogName;
/*     */   }
/*     */   
/*     */   public void setColumnType(int columnIndex, int SQLType) throws SQLException
/*     */   {
/* 368 */     checkColumn(columnIndex);
/* 369 */     this.m_colSQLType[(columnIndex - 1)] = SQLType;
/*     */   }
/*     */   
/*     */   public void setColumnTypeName(int columnIndex, String typeName)
/*     */     throws SQLException
/*     */   {
/* 375 */     checkColumn(columnIndex);
/* 376 */     this.m_colTypeName[(columnIndex - 1)] = typeName;
/*     */   }
/*     */   
/*     */   public <T> T unwrap(Class<T> iface) throws SQLException
/*     */   {
/* 381 */     return (T)iface.cast(this);
/*     */   }
/*     */   
/*     */   public boolean isWrapperFor(Class<?> iface) throws SQLException
/*     */   {
/* 386 */     return iface.isInstance(this);
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\rowset\DmdbRowSetMetaData.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */